<template>
		<FileList :item="{ label: '文件' }" :value="item" v-if="fileType"></FileList>
		<span v-else>{{ item ||'(空)'}}</span>
</template>

<script setup lang="ts">
import FileList from '@/views/aplid/DetailPage/ContentListItem/FileList/index.vue'

type Props = {
	item: any
}
const props = withDefaults(defineProps<Props>(), {})

const fileType = computed({
	get() {
		let flag = false
		let typeArr = ['.docx', '.pdf', '.xlsx', '.doc', '.jpg', '.png','.jpeg','.webp','.tiff','.heif','gif']
		const tempType = Object.prototype.toString.call(props.item)
		typeArr.map((type) => {
			if ((tempType == '[object String]' || tempType == '[object Array]') && props.item.includes(type)) {
				flag = true
			}
		})
		return flag
	},
	set() {},
})
</script>

<style scoped></style>
